import request from '@/ulits/request'
export default {
  state: {
    address: '',
    oroderInfo: '',
  },
  getters: {

  },
  mutations: {
    GETUSERADDRESS(state, address) {
      state.address = address
    },
    GETORDERINFO(state, grade) {
      state.oroderInfo = grade
    }
  },
  actions: {
    //  /user/userAddress/auth/findUserAddressList 获取用户地址信息 get请求
    async getUserAddress(state) {
      let res = await request.get('/user/userAddress/auth/findUserAddressList')
      if (res.code == 200) {
        state.commit('GETUSERADDRESS', res)
      }
    },
    // /order/auth/trade  获取订单交易信息  get请求
    async getOrderInfo(state) {
      let res = await request.get('/order/auth/trade')
      if (res.code == 200) {
        state.commit('GETORDERINFO', res.data)
      }
    },
  }
}